<?php

namespace app\middleware;


use support\Redis;
use Webman\Config;
use Webman\Http\Response;
use Webman\Http\Request;
use Webman\MiddlewareInterface;


class LoadConfig implements MiddlewareInterface
{
    public function process(Request $request, callable $next): Response
    {
        if(is_file(runtime_path('config/param.php'))){
            $loadConfigDir = dirname(runtime_path('config/param.php'));
            Config::load($loadConfigDir,[]);
        }

        return $next($request);
    }
}
